/**
 * @Title: FeedBackController
 * @Package cn.com.artemis.biz.steinsggs.web.controller
 * @Description: TODO
 * @author yulin.xu@downjoy.com
 * @date 2017/8/29 8:53
 * @version V1.0
 */
package cn.com.artemis.biz.steinsggs.web.controller;

import cn.com.artemis.biz.steinsggs.common.Result;
import cn.com.artemis.biz.steinsggs.common.util.ResultUtil;
import cn.com.artemis.biz.steinsggs.dao.FeedBackMapper;
import cn.com.artemis.biz.steinsggs.to.FeedBackTO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 *
 *@ClassName: FeedBackController
 * @Description: TODO
 * @author yulin.xu@downjoy.com
 * @date 2017/8/29 8:53
 *
 */
@Controller
@RequestMapping("/feedback")
public class FeedBackController {

    @Autowired
    private FeedBackMapper feedBackMapper;

    @RequestMapping("/save")
    @ResponseBody
    public Result save(@RequestParam String name, @RequestParam String email, @RequestParam String subject, @RequestParam String body) {
        FeedBackTO feedBackTO = new FeedBackTO();
        feedBackTO.setName(name);
        feedBackTO.setEmail(email);
        feedBackTO.setSubject(subject);
        feedBackTO.setMessage(body);
        feedBackMapper.insert(feedBackTO);
        return ResultUtil.getSuccessResult();
    }

}
